0

I need to make the pink div 100% browser height, height: 100vh doesn't work right, there's a scrollbar so it's like 105%...

html,
body {
 width: 100%;
 height: 100%;
 color: white;
 background-color: #002B5A;
 margin: 0;
 padding: 0;
 direction: rtl;
}
#right {} #left {
 min-height: 100%;
 height: 100%;
 background-color: #CA1F4B;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="right">
 right
 <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12 col-lg-offset-1 col-md-offset-1 col-sm-offset-1 col-lg-offset-1" id="left">
 left
 </div>
</div>

Check out this Bootply

Nenad Vracar
122k16 gold badges160 silver badges184 bronze badges
asked Jun 2, 2016 at 9:05
1
  • Add overflow hidden. Maybe Commented Jun 2, 2016 at 9:07

2 Answers 2

4

You need to set #right's height to 100%.

#right {
 height:100%;
}

Because #left is a child of the #right element, it is only being 100% of the parent's height. As #right is only set to height:auto; by default, it wont be 100%.

html,
body {
 width: 100%;
 height: 100%;
 color: white;
 background-color: #002B5A;
 margin: 0;
 padding: 0;
 direction: rtl;
}
#right { 
 height:100%;
}
#left {
 min-height: 100%;
 height: 100%;
 background-color: #CA1F4B;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="right">
 right
 <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12 col-lg-offset-1 col-md-offset-1 col-sm-offset-1 col-lg-offset-1" id="left">
 left
 </div>
</div>
(Look at snippet in full screen)

Bootply

answered Jun 2, 2016 at 9:06
Sign up to request clarification or add additional context in comments.

1 Comment

No worries glad I could help! @odedta
0

Try removing the min-height and changing the height to vmax, vmin or vh.

#left {
 height: 100vh;
 background-color: #CA1F4B;
}

http://www.bootply.com/dGavhuGt6g#

answered Jun 2, 2016 at 9:09

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.